package br.com.winesys.geta.databinding.componentBinder;

import java.util.List;
import br.com.winesys.geta.databinding.ComponentBinder;
import br.com.winesys.geta.databinding.component.table.ListSelector;

public final class ListSelectorBinder implements ComponentBinder<ListSelector<Object>> {

	private static final ComponentBinder<ListSelector<Object>> INSTANCE = new ListSelectorBinder();

	public static ComponentBinder<ListSelector<Object>> getInstance() {
		return INSTANCE;
	}

	private ListSelectorBinder() {
	}

	@Override
	public Object read(ListSelector<Object> component) {
		return component.getSelected();
	}

	@Override
	public void write(ListSelector<Object> component, Object value) {
		component.setSelected((List<Object>) value);
	}
}
